<template>
    <el-dialog
        width="45%"
        v-model='is_empty'
        :close-on-click-modal='false'
        :close-on-press-escape='false'
        :show-close='false'
    >
        <el-result :title="title">
            <template #icon>
                <el-image :src="image"></el-image>
            </template>
            <template #extra>
                <el-button type="primary" round @click="confirm">确定</el-button>
            </template>
        </el-result>
    </el-dialog>
</template>

<script lang="js">
import { defineComponent } from 'vue'
export default defineComponent({
    emits: ['empty'],
    props: {
        is_empty: {
            type: Boolean,
            default: false
        },
        title: {
            type: String,
            default: '未能找到相关资产'
        },
        image: {
            type: String,
            default: 'https://kouhigh.kouhigh.top/upload/app/2021_05_20/0aa56202105201719176307.png'
        }
    },
    setup(props, { emit }) {
        const confirm = () => {
            emit('empty')
        }

        return {
            confirm
        }
    }
})
</script>

<style lang="scss" scoped>
.el-image{
    width: 300px;
}
.el-button{
    width: 120px;
}
</style>